function option (name, value, color) {
  return {
    grid: {
      left: '3%',
      top: '1%',
      right: '4%',
      bottom: '30%',
      containLabel: true
    },
    yAxis: {
      type: 'category',
      data: name,
      axisTick: {
        show: false
      },
      axisLabel: { color: '#ccf8fe' },
      axisLine: {
        lineStyle: {
          color: '#022b69'
        }
      }
    },
    xAxis: {
      axisLabel: { formatter: '{value} %', color: '#ccf8fe' },
      axisTick: {
        show: false
      },
      axisLine: {
        lineStyle: {
          color: '#022b69'
        }
      },
      splitLine: {
        lineStyle: {
          color: '#101d4a',
          type: 'dashed'
        }
      }

    },
    series: [
      {
        name: '搜索引擎',
        type: 'bar',
        data: value,
        barWidth: 15,
        itemStyle: {
          normal: {
            color: {
              colorStops: [
                {
                  offset: 0,
                  color: color[0]
                }, {
                  offset: 0.2,
                  color: color[1]
                }, {
                  offset: 1,
                  color: color[2]
                }
              ]
            }
          }
        }
      }
    ]
  }
}

export { option }
